package com.iotechn.unimall.admin.api.card;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.CardDO;
import com.iotechn.unimall.data.dto.CardDTO;
import com.iotechn.unimall.data.dto.UserCardDTO;
import com.iotechn.unimall.data.model.Page;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: kbq
 * Date: 2019-07-12
 * Time: 下午10:47
 */

@HttpOpenApi(group = "admin.card", description = "会员卡")
public interface AdminCardService {

    @HttpMethod(description = "创建", permission = "promote:card:create", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public CardDO addCard(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "img", type = HttpParamType.COMMON, description = "图片") String img,
            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "会员卡标题") String title,
            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "会员卡描述") String description,
            @NotNull @HttpParam(name = "total", type = HttpParamType.COMMON, description = "会员卡总数") Integer total,
            @NotNull @HttpParam(name = "money", type = HttpParamType.COMMON, description = "金额") Integer money,
            @NotNull @HttpParam(name = "source", description = "创建方式", valueDef = "0") Integer source,
             @HttpParam(name = "allStock", type = HttpParamType.COMMON, description = "金额") Integer allStock

            ) throws ServiceException;

    @HttpMethod(description = "删除", permission = "promote:card:delete", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Boolean deleteCard(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "会员卡ID") Long id) throws ServiceException;

    @HttpMethod(description = "修改", permission = "promote:card:update", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Boolean updateCard(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "会员卡ID") Long id,
            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "会员卡标题") String title,
            @HttpParam(name = "description", type = HttpParamType.COMMON, description = "描述") String description,
            @NotNull @HttpParam(name = "total", type = HttpParamType.COMMON, description = "总数") Integer total,
            @NotNull @HttpParam(name = "money", type = HttpParamType.COMMON, description = "金额") Integer money) throws ServiceException;

    @HttpMethod(description = "修改", permission = "promote:card:update", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Boolean updateCardStatus(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "会员卡ID") Long id,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "会员卡状态") Integer status) throws ServiceException;


    @HttpMethod(description = "查询", permission = "promote:card:query", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Page<CardDTO> queryCardByTitle(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @HttpParam(name = "source", type = HttpParamType.COMMON, description = "制卡方式") Integer source,
            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "标题") String title,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "类型") Integer type,
            @HttpParam(name = "cardUse", type = HttpParamType.COMMON, description = "状态") Integer cardUse,
            @HttpParam(name = "cardNo", type = HttpParamType.COMMON, description = "卡号") String cardNo,
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit) throws ServiceException;

    @HttpMethod(description = "查询", permission = "promote:card:query", permissionParentName = "推广管理", permissionName = "会员卡管理")
    public Page<UserCardDTO> queryCardById(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @HttpParam(name = "cardNo", type = HttpParamType.COMMON, description = "会员卡号") String cardNo,
            @HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "标题") Long cardId,
            @HttpParam(name = "cardStatus", type = HttpParamType.COMMON, description = "卡状态") Integer cardStatus,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "标题", valueDef = "10") Integer limit,
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "标题", valueDef = "0") Integer pageNo
    ) throws ServiceException;


}
